﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WeChat.PlatForm.Entity;
using Microsoft.EntityFrameworkCore;
using WeChat.PlatForm.IService;
using Microsoft.AspNetCore.Http;
using WeChat.PlatForm.Web.Models;
using Microsoft.AspNetCore.Authorization;

namespace WeChat.PlatForm.Web.Controllers
{
    public class HomeController : Controller
    {
        ITestService _test;
        public HomeController(ITestService test)
        {
            _test = test;
        }

        public IActionResult Index()
        {
            _test.ToTest();
            
            return View();
        }

        [HttpPost]
        [AllowAnonymous]
        [ValidateAntiForgeryToken]

        public IActionResult LoadImage(ImageFiles Files)
        {
            IFormFile file = Files.FilesName;
            file.OpenReadStream();
            return Json("");
        }

        public IActionResult Contact()
        {
            ViewData["Message"] = "Your contact page.";

            return View();
        }
        
    }
}
